Instructions for Twistory 1.2


About Resources

     Twistory comes with a folder of text resources called "ttt" and an index file called something like "index.ttt." Double-click on this file to open Twistory.

     The files in the "ttt" folder are of two types, identified by their filename extensions. The extension ".ttt" stands for "twistory text." These files contain information on places, people and events. There are also files with the extension ".geo" which are actually just ".ttt" files, but which are so named as a comment that they contain only place data. (You can actually call the files anything you want.)

     The other kind of file has the extension ".poly" for "polygon." These are also text files, but are most easily created and edited with a separate program called PolyTool, which is included with this release.

     The following sections describe the format of the ".ttt" files. The characters "#," "<" and ">" are reserved. They may only be used as documented below. "C++ and C-style" comments may also be used. Here are examples of comments, which are ignored when Twistory reads a file:

This is not a comment.  /* This "C-type" comment begins and ends with an oblique
and an asterisk, which are reversed at the end. */  This is not a comment.
This is not a comment.  //  This "C++-type" comment begins with two obliques, and goes until the end of the line.  This IS a comment.
This is not a comment.

The File Mark-up: #file

     Twistory files are arranged in a hierarchy, and this markup is used to link them together. An index file (which can have any name) is used to list all files or sub-index files. As Twistory reads any file, if it finds the sequence "#file" it suspends reading the file it is in and opens the file whose name appears after the "#file" markup. The format is as follows:

#file "ttt/egypt.ttt"

This tells Twistory to look in the folder "ttt" for a file called "egypt.ttt" and to read its contents in right away, before finishing the current file.

     The order in which files are listed in the index, and the order in which items appear in the files, is significant. For example, a place description must be read in before it is referred to in a person record.

The Era Mark-ups: #bc and #ad

     These mark-ups have no fields, and are used to change the default era for dates. A change in the default era made within a file is forgotten once that file ends and reading returns to a file which is higher up the hierarchy. But a change is passed down to a lower file. The safest practice is to specify either #bc or #ad at the beginning of every file.

Fields

     All of the information in a place, person, event, sphere, or menu-item record is in the form of fields, which have a common format. They all begin with a field identifier between the characters < and >. The following table summarises them. Some fields, like the name, <n>, can be used with different types of records. Others can only be used with one type. The letters c, p, e, s and i indicate which records they may be used with.

     Following the table, the various fields are explained. The syntax line describes the format of the data which follows the field identifier. Remember that "white space" is always ignored in strings, i.e. tabs, carriage returns and comments and multiple spaces are all treated like single spaces. Spaces on either end of field data are ignored.

Mark-upDescriptionApplicabilitySyntaxRemarks
<n>namec p e s istringSee note
<aka>alias or alternate namec pstring 
<reg>region (name of place)c sstringThis specifies the next larger region in geographical hierarchy. (The field <sup> was used for this in the first release.)
<l>geographic locationc sgeoref 
<rad>radius (in km)c sintegerused by map to suppress legends at small scales
<col>colourc s icolourused in time-line bars
<wat>body of watercn/aboolean mark-up (no field following)
<nat>nationalityc pstringFor a place, this is the national adjective, i.e. the name for a person who lives there. (The field <adj> was used for this in the first release.) For a person, this string should match the <nat> field of some region.
<c>placep estringThis is used to specify the name of the place where a person lived or an event happened.
<info>additional informationp estringFurther information, which appears in "Info" windows; This should be in sentence form.
<ref>referencep estringThis is used to specify the reference to literature, e.g. from which book the information came.
<sur>surnamepstringThis is optional for a person. Use it if necessary to override the short forms that Twistory uses at large time scales.
<fem>femalep in/aboolean mark-up (no field following)
<o>occupationp istringThis should match an occupation defined in a menu item.
<b>date of birthpdate 
<d>date of deathpdate 
<tr>date of translationpdateThis is used in preference to <d> in a case where the person did not die, but was taken up.
<fa>father's namepstring 
<mo>mother's namepstring 
<ac>, <ap>, <pow>, <el>date of coming to powerpdateUse <ac> for accession, <ap> for appointment, <pow> for taking power, and <el> for election to office. Twistory treats these similarly.
<ab>, <depo>, <ret>date of leaving powerpdateUse <ab> for abdication, <depo> for being deposed, and <ret> for retirement from office. Twistory also treats these in a similar manner. It is not necessary to specify this date when it coincides with death.
<dep>, <arr>, <mov>dates of depature and arrivalpdateUse these, along with <c>, to describe the travels, or itinerary, of a person. The <mov> field specifies a transition between two places where the time spent travelling is not significant. Using <mov> has the same effect as using both <dep> and <arr> with the same dates.
<d>datee sdateThis field has the same abbreviation as date of death, above, but is parsed correctly in the context of an event or sphere record.
<e>ending datee sdate 
<t>event typee istringThis should match an event type defined in a menu item
<tit>titleestringThe proper title of a publication. Twistory treats this as the name of the event. The use of quotation marks around it is discouraged.
<au>link to author, inventor, etc.estringUse the name or surname of a person.
<vic>winning side of battleestringname of country
<poly>polygon file namesstring 
<icon>icon for occupation or event typeistringSee note
<off>menu item initially unselectedin/aboolean mark-up (no field following)

Names

     This should be the most common, natural name for something. For a person, it should have both given name and surname. Middle names are discouraged, unless necessary to identify a person, or if the name they go by involves a middle name. For an event, it should be as short as possible, and not be especially capitalised. Try to avoid "type" words in event names, e.g. use "Titanic" rather than "sinking of the Titanic." The icon provides type information to the user.

Georef Format

     Geographic References are given as the latitude and longitude concatenated together, in that order. Either one may be given in degrees, or degrees and minutes. Following the angle must appear one of the letters 'N' or 'S' for latitude, and 'E' or 'W' for longitude. NOTE: the degree part must consists of either 2 or 3 digits, not 1. If the angle is less than 10 degrees, a leading zero must be used. (Otherwise, it would be ambiguous whether a three-digit angle was greater than 99 degrees and given in whole degrees, or an angle less than 10 degrees with minutes following.)

Date Format

     Dates are given in the format:

[ era ] year number [ era ] [ month name [ date number ] ] [ (uncertainty) ]
The square brackets indicate optional parts. The year is the only mandatory element. It may be preceded or followed by either "A.D." or "B.C." to indicate an era other than the default; it is necessary to do this for lives or events which span the boundary between the B.C. and A.D. eras, since the default cannot be changed in mid-record.

     Following the year, the month name or its abbreviation (not number) may appear, if it is known. If the month is given, the date of the month may follow.

     Finally, an uncertainty may be given. There is already an implied uncertainty in any date that has only a year, or only year and month. For example, if only 1520 is stated, the actual date Twistory uses to draw the event is 1520 July 1, but the uncertainty will be plus or minus six months. To specify another uncertainty, put a number in round brackets following the date. (No spaces are necessary.) The units are those of the last element of the date. For example, 1889 May(3) means within three months of 1889 May 15.

Colour Format

     A colour can be specified by its RGB components, as integer percentages. For example, 100 100 100 means white, 0 0 0 means black, 100 0 0 means red, etc.

     Some colours may be specified by name. The following words are recognised as colour constants: beige, black, blue, brown, burnt orange, chartreuse, chestnut, crimson, cyan, dark grey, emerald, forest green, fuchsia, green, grey, indigo, light brown, light grey, lime green, magenta, olive, orange, oxblood, pale cyan, pale green, pale yellow, periwinkle, pink, purple, red, rose, sapphire, sea green, sky blue, turquoise, ultramarine, violet, white and yellow.

     The colours are used on the bars that indicate lifespans or extended events in the time-line window. A person is coloured according to his/her nationality, so place descriptions can have colour fields. An event is coloured according to its type, so event types (defined in menu-item records) can have colour fields too.

Icons

     If no icon is specified for an occupation or event type, these default icons are used:

Custom icons can be used. See these tables of person icons and event icons. The icon is specified by putting its name in the <icon> field of a menu-item record.

     It is possible to create additional icons if you are so inclined. You only need a program called "ResEdit," which is available free from Apple, and which is distributed with most development software. Instructions for its use are not included here.